/**
 * @name: routeIndex.ts
 * @author: XU>.<CHEN
 * @date: 2022-05-24 21:10
 * @description：routeIndex.ts
 * @update: 2022-05-24 21:10
 */
import { Router, Request, Response } from "express";
import ResponseMessage from '../utils/ResponseMessage'
import db from '../db/config'
const routeIndex:Router = Router()

// @RequestMapping(value = '/')

routeIndex.get('/', (req, res) => {
  const sql = 'SELECT * FROM ROLL_USER'
  db.query(sql, (err: any, result: any) => {
    const R = new ResponseMessage()
    res.json(R.success(result))
  })
})

routeIndex.post('/check/:id', (req, res) => {
  const result = {
    query: {
      ...req.query
    },
    params: {
      ...req.params
    },
    body: {
      ...req.body
    }
  }
  res.json(result)
})

export default routeIndex